<?php
namespace app\api\controller;
use app\BaseController;
use app\common\model\RecordModel;

class Record extends BaseController{
    public function add(){
        $user_info = $this->request->user_info;
        $staff_info = $this->request->staff_info;
        $RecordModel = new RecordModel();
        $RecordModel->type = $this->request->param('type/s','');
        $RecordModel->info = $this->request->param('info/s','');
        $RecordModel->duration = $this->request->param('duration/d',0);
        // return success($RecordModel);
        $RecordModel->firm_id = $staff_info->firm_id;
        $RecordModel->user_id = $user_info->user_id;
        $RecordModel->staff_id = $staff_info->staff_id;
        $RecordModel->save();
        return success($RecordModel);
    }
}